home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
0022-3.564
/
dmg-0122
/
st_appl.1_5
/
p_forum3
/
listing2.txt
< prev
next >
Wrap
Text File
|
1997-04-16
|
2KB
|
54 lines
/*
** Listing 2.
**
** Functional equivalent to form_do. A simple drop
** in replacement which can be modified as required.
*/
int xform_do(tree,new_edit)
OBJECT *tree;
short new_edit;
{
short cur_edit, mx, my, button, shift;
short key, click, event, pos, remain;
cur_edit = 0;
remain = TRUE;
wind_update(BEG_MCTRL);
do
{
if (new_edit != cur_edit && new_edit)
{
if (cur_edit != 0)
objc_edit(tree,cur_edit,0,&pos,ED_END);
cur_edit = new_edit;
objc_edit(tree,cur_edit,0,&pos,ED_INIT);
new_edit = 0;
}
event = evnt_multi(MU_KEYBD|MU_BUTTON,2,1,1,0,0,0,0,0,0,0,0,0,0,
NULL,0,0,&mx,&my,&button,&shift,&key,&click);
if (event & MU_BUTTON)
if ((new_edit = objc_find(tree,0,9,mx,my))== -1)
{
Bconout(2,'\007');
new_edit = 0;
}
else remain = form_button(tree,new_edit,click,&new_edit);
if (event & MU_KEYBD)
{
remain = form_keybd(tree,0,cur_edit,key,&new_edit,&key);
/* remain = xform_keybd(tree,cur_edit,shift,&new_edit,&key,&pos);*/
if (key != 0)
objc_edit(tree,cur_edit,key,&pos,ED_CHAR);
}
}
while (remain == TRUE);
objc_edit(tree,cur_edit,0,&pos,ED_END);
wind_update(END_MCTRL);
return((int)new_edit);
}